package com.iotechn.unimall.admin.api.articleClass;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dobbinsoft.fw.core.annotation.HttpMethod;
import com.dobbinsoft.fw.core.annotation.HttpOpenApi;
import com.dobbinsoft.fw.core.annotation.HttpParam;
import com.dobbinsoft.fw.core.annotation.HttpParamType;
import com.dobbinsoft.fw.core.annotation.param.NotNull;
import com.dobbinsoft.fw.core.annotation.param.Range;
import com.dobbinsoft.fw.core.exception.ServiceException;
import com.dobbinsoft.fw.support.model.Page;
import com.iotechn.unimall.data.domain.ArticleClassDO;
import com.iotechn.unimall.data.vo.SelectVO;

import java.util.List;

/**
 * 文章分类管理模块
 */
@HttpOpenApi(group = "admin.articleClass", description = "文章分类管理")
public interface ArticleClassService extends IService<ArticleClassDO> {
    @HttpMethod(description = "分页查询", permission = "article:articleClass:page", permissionParentName = "分类管理", permissionName = "通知文章")
    public Page<ArticleClassDO> page(
            @HttpParam(name = "name", type = HttpParamType.COMMON, description = "类目等级") String name,
            @HttpParam(name = "code", type = HttpParamType.COMMON, description = "父类目id") String code,
            @Range(min = 1) @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "10") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;


    @HttpMethod(description = "添加", permission = "article:articleClass:create", permissionParentName = "分类管理", permissionName = "通知文章")
    public ArticleClassDO create(
            @NotNull @HttpParam(name = "articleClassDO", type = HttpParamType.COMMON, description = "JSON数据") ArticleClassDO articleClassDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "修改", permission = "article:articleClass:edit", permissionParentName = "分类管理", permissionName = "通知文章")
    public ArticleClassDO edit(
            @NotNull @HttpParam(name = "articleClassDO", type = HttpParamType.COMMON, description = "JSON数据") ArticleClassDO articleClassDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除", permission = "article:articleClass:delete", permissionParentName = "分类管理", permissionName = "通知文章")
    public String delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "分类ID") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "分类下拉", permission = "article:articleClass:ArticleClassSelect", permissionParentName = "分类管理", permissionName = "通知文章")
    public List<SelectVO> ArticleClassSelect(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;


}
